package com.springboot.tools.action;
import com.opensymphony.xwork2.ActionSupport;
import com.springboot.tools.model.Person;
import com.springboot.tools.model.State;

import java.util.ArrayList;

public class EditAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private Person personBean;
	private String[] sports = { "football", "baseball", "basketball" };
	private String[] genders = { "a", "b", "c" };
	private static ArrayList<State> states;

	static void setAttr() {
		State state1 = new State("1", "a");
		State state2 = new State("2", "b");
		State state3 = new State("3", "c");
		ArrayList<State> arrays = new ArrayList<State>();
		arrays.add(state1);
		arrays.add(state2);
		arrays.add(state3);
	}

	public ArrayList<State> getStates() {
		return states;
	}

	public String[] getCarModelsAvailable() {
		String[] a = { "a", "b", "c" };
		return a;
	}

	public Person getPersonBean() {
		return personBean;
	}

	public void setPersonBean(Person personBean) {
		this.personBean = personBean;
	}

	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}

	public String[] getGenders() {

		return genders;
	}

	public String[] getSports() {
		return sports;
	}

}